class Greeter {
greeting: string;
constructor(message: string) {
this.greeting = message;
}
greet() {
return "Hello, " + this.greeting;
}}
let greeter = new Greeter("world");Try
export class Ingredient{
//This is a shortcut to what is written below
constructor(public name:String, public amount:String){}
}
// On top is the same as below
//
// export class Ingredient{
// public name: String;
// public amount: Number;
// constructor(name:String , amount:Number) {
// this.name = name;
// this.amount = amount;
// }
// }